package oop;

public class StudentDemo1 {
    public static void main(String[] args) {
        //创建对象
        Student stu1 = new Student();
        System.out.println("stu1 = " + stu1);
        //对象调属性查看属性
        System.out.println("stu1.name = " + stu1.name);
        System.out.println("args = " + stu1.age);
        System.out.println(stu1.gender);
        //对对象的属性进行修改
        stu1.name = "林青霞";
        stu1.age = 20;
        stu1.gender = "女孩子";
        //对象调属性查看属性
        System.out.println("stu1.name = " + stu1.name);
        System.out.println("stu1.age = " + stu1.age);
        System.out.println("stu1.gender = " + stu1.gender);

        //把stu1的地址值给stu2
        Student stu2 = stu1; //2个引用指向同一个内存区域

        stu2.name = "王祖贤";
        stu2.age = 19;
        stu2.gender = "大美女";
        System.out.println("stu2.name = " + stu2.name);
        System.out.println("stu2.age = " + stu2.age);
        System.out.println("stu2.gender = " + stu2.gender);

        System.out.println("stu1.name = " + stu1.name);
        System.out.println("stu1.age = " + stu1.age);
        System.out.println("stu1.gender = " + stu1.gender);

        String str = "Hello";
        System.out.println("str = " + str);
    }
}
